package ckw.communication;

import java.net.BindException;
import java.util.HashMap;

import ckw.database.model.Election;
import ckw.database.model.Member;
import ckw.database.model.Node;
import ckw.database.model.Voter;
import core.communication.message.CNodeState;
import core.communication.message.ElectionStatusMessage;
import core.communication.message.Message;
import core.communication.message.VerifyNonresidentVoterMessage;
import core.communication.message.VotersPackageMessage;
import core.communication.message.VotesPackageMessage;

public interface CommunicationService {

	public void setUp() throws BindException;

	public void shutDown();

	public Message getMessageToSend();

	public HashMap<String, Client> getClients();

	public void resendMessage(Message message);

	public void removeMessageToSend(Message message);

	public void addClientToCheck(Client client);

	public Message getReceivedMessage();

	public void removeReceivedMessage(Message message);

	public void updateNodeState(String locatorURI, CNodeState nodeState);

	public Client getClientToCheck();

	public void reAddClientToCheck(Client client);

	public void addReceivedMessage(Message message);

	public void removeClientToCheck(Client client);

	public void deleteClient(String locatorUri);

	public void send(Message message);

	public void addClient(Node node);

	public void changeClient(String oldLocatorURI, Node node);

	public void sendConfigurations();

	public void sendElectionConfiguration(Election election);

	public void sendVoterUpdate(String identificationField, Voter voter);

	public void sendMemberUpdate(String identificationField, Member member);

	public void verifyVoter(VerifyNonresidentVoterMessage message);

	public void changeElectionStatus(ElectionStatusMessage message);

	public void handleVotesPackage(VotesPackageMessage message);

	public void handleVotersPackage(VotersPackageMessage message);
	
	public void setPath(Message message);
}
